<?php
defined('IN_MAIN') or exit('Invalid Access!');

function ndate($format="", $time=""){
global $vars;
 $time_t=(strlen($time)? $time : time());
 $server_offset=date("Z");
 $local_offset=$vars["timezone_offset"]*3600;
 $local_time=$time_t-$server_offset+$local_offset;
 $nformat=$format? $format : "Y-m-d H:i:s";
 return date($nformat, $local_time);
}
?>